<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/12/4
 * Time: 20:07
 */
header("content-type:text/html;charset=utf8");
class server{
    private $name;
    private $s_token = "api";
    private $c_token;
    private $time;
    private $random;
    private $mathes;

    function __construct()
    {
        $this->name=$_GET['name'];
        $this->c_token=$_GET['token'];
        $this->time=$_GET['time'];
        $this->random=$_GET['random'];
        $this->mathes=$_GET['mathes'];
        $this->login();
    }
    public function login(){
        if ($this->c_token==$this->s_token){
            $arr=array('code'=>1,'msg'=>"欢迎你".$this->name);
        }else{
            $arr=array('code'=>0,'msg'=>"滚蛋！");
        }
        echo json_encode($arr);
    }

}